# workerman
# https://www.workerman.net/download/php/php-8.1-linux-x86_64.tar.gz
# https://www.workerman.net/download/php/php-8.2-linux-x86_64.tar.gz
# https://www.workerman.net/download/php/php-8.3-linux-x86_64.tar.gz
# https://www.workerman.net/download/php/php-8.4-linux-x86_64.tar.gz
# tar -xf php-8.1-linux-x86_64.tar.gz
# tar -xf php-8.2-linux-x86_64.tar.gz
# tar -xf php-8.3-linux-x86_64.tar.gz
# tar -xf php-8.4-linux-x86_64.tar.gz
# https://download.workerman.net/php/composer.phar
# mv composer.phar /usr/local/bin/composer
# chmod a+x /usr/local/bin/composer
FROM debian:12.9-slim
LABEL author=xiaoyilin
LABEL email=406735078@qq.com
ENV TZ=Asia/Shanghai
ARG P_V
COPY php${P_V} composer /usr/local/bin
WORKDIR /usr/local
RUN mv /usr/local/bin/php${P_V} /usr/local/bin/php && composer create-project workerman/webman
WORKDIR /usr/local/webman
# 调试方式运行（开发调试，打印数据会显示在终端，终端关闭后webman服务也随之关闭）
ENTRYPOINT ["php", "start.php", "start"]
# 守护进程方式运行（正式环境，打印数据不会显示在终端，终端关闭后webman服务会持续运行）
# ENTRYPOINT ["php", "start.php", "start", "-d"]

# docker build --build-arg P_V=81 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.1 .
# docker build --build-arg P_V=82 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.2 .
# docker build --build-arg P_V=83 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.3 .
# docker build --build-arg P_V=84 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.4 .

# docker run -p 8787:8787 --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.1
# docker run -d -p 8787:8787 registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.1
# docker run -it --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.1 bash
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.1
# docker pull registry.cn-hangzhou.aliyuncs.com/xiaoyilin/webman:2.1.0-php8.1